cmake_minimum_required(VERSION 3.10)
project(test-library)

include_directories("${CMAKE_SOURCE_DIR}/include")

if (NOT BUILD_SHARED_LIBS)
    message("detect use STATIC")
    add_library(${PROJECT_NAME} STATIC src/TestClass.cpp)
else()
    message("detect use SHARED")
    add_library(${PROJECT_NAME} SHARED src/TestClass.cpp)
endif ()

install(TARGETS ${PROJECT_NAME}
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib)

install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config)
install(EXPORT ${PROJECT_NAME}Config DESTINATION lib/cmake/${PROJECT_NAME})

install(FILES include/TestClass.h DESTINATION include/${PROJECT_NAME})
